package team.seekers.hula.course.structure.section.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import team.seekers.hula.common.annotation.ApiResponseBody;
import team.seekers.hula.auth.service.MindUtils;
import team.seekers.hula.course.structure.section.service.SectionProgressService;

/**
 * date: 2022/5/11 10:50
 *
 * @author GH
 * QQ 1124813753
 */
@Controller
@ApiResponseBody
@RequestMapping("/section/progress")
public class SectionProgressController {

    @Autowired
    private SectionProgressService sectionProgressService;


    /**
     * 更新节学习进度
     */
    @GetMapping("/update")
    public void updateProcess(@RequestParam String sectionId,
                              @RequestParam Integer progress) {
        sectionProgressService.updateProgress(sectionId, progress, MindUtils.getUserId());
    }
}
